/**
 * 参考案例: https://github.com/egoist/svg-to-vue-component.git
 * @example
    const svgRule = config.module.rules.find(rule => rule.test.test('.svg'))
    svgRule.test = /\.(png|jpe?g|gif|webp)$/
    config.module.rules.push({
        test: /\.svg$/,
        use: ['vue-loader', {
            loader: path.resolve(__dirname, 'build/loader/svgToVueComponent'),
        }],
    })
 * @param {String} src 
 * @returns {String}
 */
module.exports = function vueSvgLoader(src) {
    this.cacheable()
    let svg = src.replace('<svg', '<svg v-on="$listeners"');
    svg = `<template>${svg}</template>`
    return svg
};